How does document.getElementByID works